package com.ruoyi.business;

import com.alibaba.fastjson.JSON;
import com.ruoyi.business.dto.TicketDTO;
import org.springframework.util.CollectionUtils;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.Collections;
import java.util.List;

public class Test2 {

    public static void main(String[] args) {
        try {
            String a = "---------------";
            String b = "获取交易行秦穆公";
            String c = "[{\"symbol\": \"SHSE.515700\", \"price\": 1.475, \"open\": 1.48, \"high\": 1.494, \"low\": 1.472}]";

            List<TicketDTO> ticketDTOS = JSON.parseArray(c, TicketDTO.class);
            if(!CollectionUtils.isEmpty(ticketDTOS)){
                System.out.println(ticketDTOS.get(0).toString());
            }

        } catch (Exception e) {
            e.printStackTrace();
        }

    }


}
